import Vue from 'vue'

Vue.filter('nullSting', (val) => {
  return val + ''
})
Vue.filter('addHomePath', (val) => {
  return '/home/' + val
})
Vue.filter('dateFormat', (val) => {
  const date = new Date(val)
  const y = date.getFullYear()
  const m = (date.getMonth() + 1 + '').padStart(2, '0')
  const d = (date.getDate() + '').padStart(2, '0')

  const hh = (date.getHours() + '').padStart(2, '0')
  const mm = (date.getMinutes() + '').padStart(2, '0')
  const ss = (date.getSeconds() + '').padStart(2, '0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
